package day10.Ti.FileDome;

import java.io.File;
import java.util.Scanner;

public class Lian01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个路径");
        String s = sc.nextLine();
        File file=new File(s);
        boolean exists = file.exists();
        System.out.println("这个路径是否存在? "+exists);
        boolean file1 = file.isFile();
        System.out.println("这是一个文件吗? "+file1);
        String path = file.getAbsolutePath();
        System.out.println("绝对路径是"+path);
        String name = file.getName();
        System.out.println("文件名字是"+name);
        long l = file.length();
        System.out.println("文件的长度为"+l);
    }
}
